package com.sch.www.codeGenerator.dao;

import java.util.ArrayList;
import java.util.List;

public class sys {


    public static void main(String[] args) throws Exception {

        List<Table> tableList = new ArrayList<>();
        tableList.add(new Table("sys_account", "Account"));
        tableList.add(new Table("sys_account_to_role", "AccountToRole"));
        tableList.add(new Table("sys_role", "Role"));
        tableList.add(new Table("sys_role_to_resource", "RoleToResource"));
        tableList.add(new Table("sys_resource", "Resource"));

        String userDir = System.getProperty("user.dir");


        GeneratorProperties gp = new GeneratorProperties();
        gp.setDb(new GeneratorProperties.Db("root", "hong10086", "jdbc:mysql://106.12.95.23:3306/mp", "com.mysql.jdbc.Driver", userDir + "/code-generator/lib/mysql-connector-java-5.1.38.jar"));

        String group = "com.sch.www";
        gp.setEntityTargetProject("service-api/sys-api/src/main/java");
        gp.setAutomaticEntityPackageName(group + ".sys.orm.entity.automatic");
        gp.setManualEntityPackageName(group + ".sys.orm.entity.manual");
        gp.setEntityRootClass(group + ".common.base.BaseEntity");


        gp.setDaoTargetProject("service-api-impl/sys-api-server/src/main/java");
        gp.setAutomaticDaoPackageName(group + ".sys.orm.dao.automatic");
        gp.setManualDaoPackageName(group + ".sys.orm.dao.manual");


        gp.setMapperTargetProject("service-api-impl/sys-api-server/src/main/resources");
        gp.setAutomaticMapperPackageName("mapper.automatic");
        gp.setManualMapperPackageName("mapper.manual");






        gp.setTableList(tableList);

        MybatisGenerator g = new MybatisGenerator(gp);
        g.generator();


    }


}
